package com.ecmap.hongyun.commons.utils;

import java.text.SimpleDateFormat;
import java.util.Date;

public class DateUtil {
	/**
	 * 转换日期为特定格式的字符串
	 * @param date
	 * @param pattern
	 * @return
	 */
	public static String convertDate(Date date,String pattern){
		SimpleDateFormat format = new SimpleDateFormat(pattern);
		return format.format(date);
	}
	
	public static void main(String[]args){
		System.out.println(convertDate(new Date(),"yyyy-MM-dd"));
	}
}
